#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int factorial(int n)
{
	int sum = 1;
	for (int i = 2; i <= n; i++)
	{
		sum = sum * i;
	}
	return sum;
}
int main()
{
	int n;
	scanf("%d", &n);
	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		sum = sum + factorial(i);
	}
	printf("%d", sum);
	system("PAUSE");
	return 0;
}